{% extends "base.html" %}


{% block content %}


{% for c in commands %}
 <button type=button class="bigbutton" command="{{c}}">{{c}}</button>
{% end %}


<div class=info>
  <pre id="status">
    {{status}}
  </pre>
</div>



<script>
$(function() {
    console.log("system setup");
    function ShowResult(data, status) {
        console.log("command completed [" + status + "]");
        //console.log("command completed [" + data + "]");
        $("#status").html(data);
    }

    function SendCommand(command) {
        console.log(command);
        $.get("/system_command", {command: command}, ShowResult);
    }

    function ButtonClick() {
         var command = $(this).attr("command");
         SendCommand(command);
    }

    $("button").click(ButtonClick);
 });

 </script>

{% end %}
